Skip to content

v9.6.0 - LabApi 1.1.7 - #91

Open
MedveMarci wants to merge 47 commits into
labapifrom
dev-labapi
Open

v9.6.0 - LabApi 1.1.7#91
MedveMarci wants to merge 47 commits into
labapifrom
dev-labapi

Conversation

@MedveMarci

Copy link
Copy Markdown
Member

No description provided.

…ager; improved role listing in Percentages; imported roles now correctly getting reloaded and shown in Percentages
…y,regenerate over time) never applied its maximum
…Added Role and CustomFlag value validators; Some improvements in code; Cleaned up and formatted solution;
- Add CustomRoleExtension with helper methods for custom role
- Refactor CustomRole.cs and add new methods
- Update CompatibilityManager with whitespace cleanup
…ole gets removed; fixed CustomKeycard Placeholders with RpNames;
…; implement InfoTag module for custom info display
@FoxWorn3365
FoxWorn3365 self-requested a review August 27, 2026 20:59

@FoxWorn3365 FoxWorn3365 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll end here my review because it was painful.
Probably because of AI or Rider refactoring but the code is now wayy too unreadable.
The main problems are: an ENORMOUS USE OF "var" (dynamic type) which is really pointless and the only thing it does is making the code not user friendly and unreadable (without an IDE).
The other problem was that sometimes some functions were just
continued on a new
line because they were too
long.
Something like that is painful to read.
result =
"HELLO"
is something that I would dream only in a nightmare.

The others are just some suggestions but I warn you that I've stopped my review at the 77th file (/155 - /Commands/SpawnPoint.cs) because I was just writing the same two-three things over and over.

if (ev is null)
return;

foreach (var handler in ev.GetInvocationList())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using "var"

inZone = true;

if (!_wasInEscapeZone)
PlayerEventHandler.Instance.OnEscaping(new PlayerEscapingEventArgs(_role.Player.ReferenceHub,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please write everything in a single line

{
internal class AmnesiaResistance : CustomModule
{ }
} No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid doing
{
}
instead, opt for
{ }

public override bool Validate(out string error)
{
public override List<string> RequiredArgs => new()
var raw = TryGetStringValue("color", string.Empty);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using "var"

var tokens = TokenRegex.Matches(Order).Cast<Match>().Select(m => m.Groups[1].Value).ToList();

var unknown = tokens
.Where(t => !KnownTokens.Contains(t, StringComparer.OrdinalIgnoreCase))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only case when writing on multiple lines is accepted

}

response = "Custom roles of every player:";
foreach (var Player in Player.ReadyList.Where(p => !p.IsHost))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using var


response = "Custom roles of every player:";
foreach (var Player in Player.ReadyList.Where(p => !p.IsHost))
if (Player.TryGetSummonedInstance(out var summoned))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using var


if (!int.TryParse(arguments[1], out var id))
{
response =

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the same line

return false;
}

var result = string.Empty;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using var (x3)

private string SpawnPlayer(Tuple<string, Player> rawPlayer, int id, bool sync)
private static string SpawnPlayer(Tuple<string, Player> rawPlayer, int id, bool sync)
{
var player = rawPlayer.Item2;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using var

@FoxWorn3365 FoxWorn3365 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll end here my review because it was painful.
Probably because of AI or Rider refactoring but the code is now wayy too unreadable.
The main problems are: an ENORMOUS USE OF "var" (dynamic type) which is really pointless and the only thing it does is making the code not user friendly and unreadable (without an IDE).
The other problem was that sometimes some functions were just
continued on a new
line because they were too
long.
Something like that is painful to read.
result =
"HELLO"
is something that I would dream only in a nightmare.

The others are just some suggestions but I warn you that I've stopped my review at the 77th file (/155 - /Commands/SpawnPoint.cs) because I was just writing the same two-three things over and over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants